package com.cool.modules.finance.service.account;

import cn.hutool.json.JSONObject;
import com.cool.core.base.BaseService;
import com.cool.modules.finance.dto.FinancePaymentAccountVo;
import com.cool.modules.finance.dto.FinanceTransferAccountVo;
import com.cool.modules.finance.dto.TreeAccountVo;
import com.cool.modules.finance.entity.account.FinanceAccountEntity;

import java.util.List;

public interface FinanceAccountService extends BaseService<FinanceAccountEntity> {

    /**
     * 验证余额
     * @param financeTransferAccountVo
     * @return
     */
    boolean checkBalance(FinanceTransferAccountVo financeTransferAccountVo);

    /**
     * 验证余额和转账
     * @param financeTransferAccountVo
     * @param saveRecord
     * @return
     */
    boolean checkBalanceAndTransfer(FinanceTransferAccountVo financeTransferAccountVo,boolean saveRecord);

    /**
     * 验证余额和付款
     * @param financePaymentAccountVo
     * @return
     */
    boolean checkBalanceAndPayment(FinancePaymentAccountVo financePaymentAccountVo);

    /**
     * 树形 账户菜单
     * @param requestParams
     * @return
     */
    List<TreeAccountVo> treeAccount(JSONObject requestParams);

    /**
     * 转账
     * @param transferAccountVo
     * @return
     */
    Object transfer(FinanceTransferAccountVo transferAccountVo);

    /**
     * 撤销转账
     * @param requestParams
     * @return
     */
    Object delTransfer(JSONObject requestParams);

    /**
     * 赎回理财账户
     * @param requestParams
     * @return
     */
    Object redeemAccount(JSONObject requestParams);
}
